package com.gitee.feizns.upload.domain.pojo;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import com.gitee.feizns.bean.Convertible;
import com.gitee.feizns.upload.domain.enums.ResourceType;
import com.gitee.feizns.web.dao.ar.AbstractModel;
import com.gitee.feizns.web.dao.handler.meta.annotation.Now;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @author feizns
 * @since 2019/8/9
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Resource extends AbstractModel<Resource> implements Serializable, Convertible {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 资源类型
     */
    private ResourceType type;

    /**
     * 文件名称
     */
    private String filename;

    /**
     * 决对路径
     */
    private String abUrl;

    /**
     * 上传ip4
     */
    private String fromIp;

    /**
     * 创建时间
     */
    @Now
    @TableField(fill = FieldFill.INSERT)
    private Date createdAt;

}
